import Config from "../main.config";
import Ajax from "../utils/Ajax";
import {setStorageSync} from "../utils/Storage";
module.exports = {

    /*
    * 获取员工信息详情
    * */
    getRegisterDetail: async function (createUser) {
        let url = Config.api.personnelDetail;
        let res = await Ajax.request({
            method: "POST",
            url,
            data: {
                createUser
            }
        });
        setStorageSync(Config.storage.registerInfo, res);
        return res
    },

    /*
    * 创建员工
    * */
    createUser: async function (data) {
        let url = Config.api.personnelCreate;
        return await Ajax.request({
            method: "POST",
            url,
            data
        })
    },

    /*
    * 编辑员工信息
    * */
    editUser: async function (data) {
        let url = Config.api.personnelEdit;
        return await Ajax.request({
            method: "POST",
            url,
            data
        })
    },

    /*
    * 获取员工列表信息  --学生首页
    * */
    getAlumniList: async function (data = {}) {
        let url = Config.api.personnelAlumniList;
        return await Ajax.request({
            method: "POST",
            url,
            data
        })
    },

    /*
    * 获取员工管理信息列表  -- 企业员工管理
    * */
    getEnterpriseList: async function (data = {}) {
        let url = Config.api.personnelEnterpriseList;
        return await Ajax.request({
            method: "POST",
            url,
            data
        })
    },

    /*
    * 员工权限管理  -- 企业员工管理
    * */
    authorizationSetting: async function (data = {}) {
        let url = Config.api.personnelEnterpriseEdit;
        return await Ajax.request({
            method: "POST",
            url,
            data
        })
    },

    /*
    * 删除员工  -- 企业员工管理
    * */
    enterpriseDelete: async function (id) {
        let url = Config.api.enterpriseDelPersonnel;
        return await Ajax.request({
            method: "POST",
            url,
            data: {id}
        })
    },

    /*
    * 获取学长所在公司 -- 学生首页
    * */
    getEntryCompanyList: async function (schoolNo) {
        let url = Config.api.personnelCompanyList;
        return await Ajax.request({
            method: "POST",
            url,
            data: {schoolNo}
        })
    },

    /*
    * 获取学长详情 --- 学生
    * */
    getSeniorDetail: async function (id) {
        let url = Config.api.personnelSeniorDetail;
        return await Ajax.request({
            method: "POST",
            url,
            data: {id}
        })
    },

}